Skip to contents

get expanded version of data.table, such as copy(blockgroupstats), with new lat,lon columns

Usage

latlon_join_on_bgid(x)

Arguments

x

data.table with column called bgid (as used in bgid2fips or blockgroupstats)

Value

x with 2 new columns but side effect is it updates x in calling envt

Examples

# quick map of blockgroups in 1 state, shown as blockgroup centroids
myst <- "NY"
dat <- bgpts[fips2state_abbrev(substr(bgfips,1,2)) == myst, ]
mapfast(dat, radius = 0.1)
# same but popups have all the indicators from EJScreen myst <- "NY" dat <- copy(blockgroupstats[ST == myst, ]) #> Error in copy(blockgroupstats[ST == myst, ]): could not find function "copy" # add latlon cols by reference: latlon_join_on_bgid(dat) #> Error in latlon_join_on_bgid(dat): could not find function "latlon_join_on_bgid" # specify useful labels for the map popups mapfast(dat, radius = 0.1, labels = fixcolnames(names(dat), 'r', 'shortlabel'))
## or add the useful labels to the table 1st names(dat) <- fixcolnames(names(dat), "r", "shortlabel") mapfast(dat, radius = 0.1) #> Replaced column names that were inferred to be and therefore renamed as the lat and/or lon columns!